<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>欢迎登录</title>
</head>
<style type="text/css">
	body{ 
		background:url(Welcome.jpg) no-repeat; 
		background-size:cover;
		font: 24px/1.5 Tahoma,Helvetica,Arial,'华文中宋','宋体',sans-serif; 
		font-weight:bolder}
	
	p1,p2{color:black;}
	a{color:black; font:16px/1.5 Tahoma,'宋体'}
</style>
<body>
<a href="login.html" >注销当前用户</a><br>
<p1>下面显示已注册用户信息：<br>
用户名称&nbsp;&nbsp;注册邮箱<br></p1>
<div id="info"></div>

</body>
<script type="text/javascript">

if (typeof(Storage) !== "undefined") { 
	//localStorage.clear();
	var result=" ";
	for(var i=0;i<localStorage.length;i++){  //调用key方法获取localStorage中数据对应的键名  
      //localStorage.key(0)对应data1  
      var getKey=localStorage.key(i);  
	  if(getKey.substring(0,6)=="userID"){ 
      //通过键名获取值，包括用户名称、用户密码和电子邮件信息
	  	var str=localStorage.getItem(getKey);  
	  	var data=JSON.parse(str);
		result+="用户名:&nbsp;&nbsp;"+data.username+"&nbsp;EMAIL:&nbsp;&nbsp; "+data.mail+"<br>";
	  }
	 }
	 document.write(result);
}else {
	info.innerHTML = "抱歉！您的浏览器不支持 WebStorage ...";
}
</script>
</html>
